<template>
  <div>
    <el-form ref="form" :model="form" label-width="80px" style="display: flex; flex-direction: row">
      <el-form-item label="姓名">
        <el-input v-model="form.name" placeholder="请输入姓名" style="width: 200px"></el-input>
      </el-form-item>
      <el-form-item label="所属部门">
        <el-input v-model="form.name" style="width: 200px" placeholder="请输入部门"></el-input>
      </el-form-item>
      <el-form-item label="手机号">
        <el-input v-model="form.name" style="width: 200px" placeholder="请输入手机号"></el-input>
      </el-form-item>
    </el-form>
    <div class="big">
      <div class="one">
        <el-button size="small"><i class="el-icon-search"></i> 查询</el-button>
        <el-button size="small"> <i class="el-icon-refresh-right"></i>重置</el-button>
      </div>
      <div class="two">
        <el-button size="small" style="background-color: rgb(212, 169, 233)" @click="dialogFormVisible=true"><i class="el-icon-circle-plus-outline"></i>新增用户</el-button>
      </div>
    </div>
    <!-- 弹出框 -->
    <el-dialog title="新增用户" :visible.sync="dialogFormVisible">
  <el-form :model="form1">
    <el-form-item label="用户名称" :label-width="formLabelWidth">
      <el-input v-model="form.name" autocomplete="off" placeholder="请输入用户名称"></el-input>
    </el-form-item>
    <el-form-item label="账号" :label-width="formLabelWidth">
      <el-input v-model="form.zh" autocomplete="off" placeholder="请输入账号"></el-input>
    </el-form-item>
    <el-form-item label="手机号" :label-width="formLabelWidth">
      <el-input v-model="form.model" autocomplete="off" placeholder="请输入手机号"></el-input>
    </el-form-item>

    <el-form-item label="角色名称" :label-width="formLabelWidth">
      <el-select v-model="form.peaple" placeholder="管理员角色">
        <el-option label="管理员角色" value="管理员角色"></el-option>
        <el-option label="普通用户" value="普通用户"></el-option>
        <el-option label="部门管理员" value="部门管理员"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="所属岗位" :label-width="formLabelWidth">
      <el-select v-model="form.gangwei" placeholder="销售岗">
        <el-option label="销售岗" value="销售岗"></el-option>
        <el-option label="技术岗" value="技术岗"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="所属职位" :label-width="formLabelWidth">
      <el-select v-model="form.zhiji" placeholder="1">
        <el-option label="1" value="1"></el-option>
        <el-option label="2" value="2"></el-option>
        <el-option label="3" value="3"></el-option>
      </el-select>
    </el-form-item>
    <el-form-item label="所属部门" :label-width="formLabelWidth">
      <el-select v-model="form.bumen" placeholder="1">
        <el-option label="1" value="1"></el-option>
        <el-option label="2" value="2"></el-option>
        <el-option label="3" value="3"></el-option>
      </el-select>
    </el-form-item>
  </el-form>
  <div slot="footer" class="dialog-footer">
    <el-button @click="dialogFormVisible = false">取 消</el-button>
    <el-button type="primary" @click="add">确 定</el-button>
  </div>
</el-dialog>
    <!-- 表格 -->
    <el-table :data="tableData" border style="width: 100%;margin-top: 20px;" >
      <el-table-column pro="id" label="id" width="50px" align="center"> 
      </el-table-column>
      <el-table-column prop="name" label="用户名称" align="center"> </el-table-column>
      <el-table-column prop="zh"   label="账号" align="center"> </el-table-column>
      <el-table-column prop="model" label="手机号" align="center"> </el-table-column>
      <el-table-column prop="peaple" label="所属角色" align="center"> </el-table-column>
      <el-table-column prop="zhiji" label="所属职级" align="center"> </el-table-column>
      <el-table-column prop="bumen" label="所属部门" align="center"> </el-table-column>
      <el-table-column fixed="right" label="操作" align="center">
        <template slot-scope="scope">
          <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
          <el-button type="text" size="small">编辑</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
  data() {
    return {
        tableData:[
      {
        id:1,
      name:'12',
      zh:12,
      model:1234124,
      peaple:'zs',
      zhiji:2,
      bumen:4
      }
      ],
      form: {
        name: '',
        zh:'',
        model:'',
        peaple:'',
        gangwei:'',
        zhiji:'',
        bumen:''
      },
      dialogFormVisible: false,
        form1: {
          name:'',
          zh:'',
          model:'',
          peapl:'',
          zhiji:'',
          bumen:''
        },
        formLabelWidth: '120px'
    }
  },
  methods: {
   
    add(){
    this.tableData.push(this.form)
    },
  },
}
</script>
<style scoped>
.big {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
}
</style>
